<template>
  <div class="index">
    <el-container>
      <el-aside :width="sideWidth">
        <sidebar />
      </el-aside>
      <el-container>
        <el-header>
          <headerbtn></headerbtn>
          <breadcrumb></breadcrumb>
          <thisMessage></thisMessage>
        </el-header>
        <el-main>
          <tag></tag>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import sidebar from "@/components/menu/sidebar";
import headerbtn from "@/components/header/headerBtn.vue"
import breadcrumb from "@/components/header/breadcrumb.vue";
import thisMessage from "@/components/header/thisMessage.vue";
import tag from "@/components/tag/index.vue"
export default {
  name: "userIndex",
  components: {
    sidebar,
    headerbtn,
    breadcrumb,
    thisMessage,
    tag
  },
  data() {
    return {
      sideWidth: this.$store.getters.getControllerBtn ? "65px" : "200px"
    }
  },

  watch: {
    '$store.getters.getControllerBtn': function (val) {
      if (val) {
        this.sideWidth = "65px"
      } else {
        this.sideWidth = "200px"
      }
    }
  }
}
</script>

<style scoped>
.index {
  height: 100%;
}

.el-container {
  height: 100%;
}

.el-header,
.el-footer {
  color: #333;
  text-align: left;
  line-height: 50px;
  max-height: 50px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #f3efef;
}

.el-aside {
  background-color: #fff;
  color: #333;
  text-align: left;
  border-right: 1px solid #d8d0d0;
  overflow-x: hidden;
}

.el-main {
  background-color: #fff;
  color: #333;
  text-align: left;
  padding-top: 0px;
}

/**
tag行修饰
 */
.el-main .tab-container{
  margin-left: -20px;
  margin-right: -20px;
  margin-bottom: 10px;
}

/*
  在实现侧边栏收缩时，collapse-transition 失效，在出口处（el-aside）加上这个样式
*/
.el-aside {
  transition: width 0.15s;
  -webkit-transition: width 0.15s;
  -moz-transition: width 0.15s;
  -webkit-transition: width 0.15s;
  -o-transition: width 0.15s;
}


</style>